package com.spr.controller;

import com.spr.mapper.SprDeviceCompleteRecordMapper;
import com.spr.pojo.SprDeviceStatusRecord;
import com.spr.service.SprDeviceCompleteRecordService;
import com.spr.vo.SprChargeStatisticsVO;
import com.spr.vo.SprDeviceCompleteRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sprDeviceCompleteRecord")
@Slf4j
@Api(tags = "设备完工记录-控制类")
public class SprDeviceCompleteRecordController {
    @Autowired
    private SprDeviceCompleteRecordService sprDeviceCompleteRecordService;

    @ApiOperation(value = "完工记录")
    @GetMapping("/completeRecord")
    public ResponseEntity<List<SprDeviceCompleteRecordVO>> completeRecord(){
        List<SprDeviceCompleteRecordVO> sprDeviceCompleteRecordVOS= sprDeviceCompleteRecordService.getCompleteRecord();
        return ResponseEntity.ok(sprDeviceCompleteRecordVOS);
    }


    @ApiOperation(value = "实时状态信息")
    @GetMapping("/realtimeStatusInformation")
    public ResponseEntity<List<SprDeviceStatusRecord>> realtimeStatusInformation(){
        List<SprDeviceStatusRecord> sprDeviceStatusRecords= sprDeviceCompleteRecordService.realtimeStatusInformation();
        return ResponseEntity.ok(sprDeviceStatusRecords);
    }
}
